package com.example.demo.aliyunmessage.controller;

import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.example.demo.aliyunmessage.entity.Message;
import com.example.demo.aliyunmessage.service.MessageServiceImpl;
import com.example.demo.utils.SendMessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName MessageController
 * @Author lys4134
 * @Date 2021/08/03 16:41:50
 * @Description MessageController
 * @Version 1.0
 **/
@RestController
@RequestMapping("/sendMessage")
public class MessageController {
    @Autowired
    private MessageServiceImpl messageService;

    @GetMapping("/sendSms")
    @ResponseBody
    public String sendSms() throws ClientException {
        messageService.sendSms();
        return "success";
    }

}
